package com.wangjw.tuling.netty.rpc.server;

import com.wangjw.tuling.netty.rpc.common.CalculatorService;
import com.wangjw.tuling.netty.rpc.common.CalculatorServiceImpl;
import com.wangjw.tuling.netty.rpc.common.RpcBuilder;

/**
 * Created by wangjianwen on 2018/12/11.
 */
public class RpcDemoServer {

    public static void main(String[] args) {
        RpcBuilder rpcBuilder = new RpcBuilder();
        rpcBuilder.publishService(CalculatorService.class, new CalculatorServiceImpl());

        NettyServer server = new NettyServer(8080);
        try {
            server.start(rpcBuilder);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
